package bdqn.t09.util;

import java.util.List;

public class Pageinfo {
        private Integer currIndex;
        private Integer rows;
        private List<?> list;
        private Integer count;

        public Integer getCurrIndex() {
            return currIndex;
        }

        public Integer getTotal(){
            return (getCount()-1) / getRows()+1;
        }
        public Integer getPrev(){
            if(currIndex> 1){
                return currIndex -1;
            }
            return 1;
        }
        public  Integer getNext(){
            Integer total = getTotal();
            if(currIndex < total){
                return currIndex +1;
            }
            return total;
        }

        public void setCurrIndex(Integer currIndex) {
            this.currIndex = currIndex;
        }

        public Integer getRows() {
            return rows;
        }

        public void setRows(Integer rows) {
            this.rows = rows;
        }

        public List<?> getList() {
            return list;
        }

        public void setList(List<?> list) {
            this.list = list;
        }

        public Integer getCount() {
            return count;
        }

        public void setCount(Integer count) {
            this.count = count;
        }
    }


